<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019-08-08
 * Time: 17:16
 */

namespace App\Models;

use Illuminate\Support\Facades\Auth;
use Illuminate\Database\Eloquent\Builder;

/**
 * 用户登录记录表
 * Class Goods
 * @package App\Models
 */
class UserLoginLog extends BaseModel
{
    /**
     * 与模型关联的数据表
     *
     * @var string
     */
    protected $table = 'user_login_log';

    /**
     * 需要被转换成日期的属性。
     *
     * @var array
     */
    protected $dates = ['login_time'];

    /**
     * 用户
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function user(){
        return $this->belongsTo(User::class)->select('id', 'username', 'realname', 'mobile');
    }

}